package cn.com.surker.material.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 材料合同价格表
 * </p>
 *
 * @author admin
 * @since 2024-06-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class MainMaterialContractPrice implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long orgId;
    /**
     * 材料合同ID
     */
    private Long contractId;

    /**
     * 材料ID
     */
    private Long materialId;

    /**
     * 供应商ID
     */
    private Long supplierId;

    /**
     * 承运商
     */
    private Long transportId;

    /**
     * 结算类型(0:按过磅重量结算，1：按供方重量计算)
     */
    private Integer billWeightType;

    /**
     * 价格
     */
    private Double price;
    /**
     * 含税单价
     */
    private Double taxPrice;

    /**
     * 生效时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date takeTime;

    /**
     * 执行类型(0:材料1:运输)
     */
    private Integer type;

    /**
     * 备注
     */
    private String priceRemark;
    /**
     * 是否结算(0:是1:否)
     */
    private Integer isBill;

    /**
     * 状态(0:启用1：禁用)
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    /**
     * 修改人
     */
    private String updator;
    /**
     * 原有价格
     */
    @TableField(exist = false)
    private Double oldPrice;

    @TableField(exist = false)
    private String takeDate;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updateTime;
    public MainMaterialContractPrice(){}
    public MainMaterialContractPrice(Long contractId, Long materialId, Long supplierId, Double price, Date takeTime, Integer type, Integer isBill, Integer status, String remark, String creator, Date createTime) {
        this.contractId = contractId;
        this.materialId = materialId;
        this.supplierId = supplierId;
        this.price = price;
        this.takeTime = takeTime;
        this.type = type;
        this.isBill = isBill;
        this.status = status;
        this.remark = remark;
        this.creator = creator;
        this.createTime = createTime;
    }
}
